<template>
	<view>
		<view @click="nav_go" class="listItem">
			<view class="left">
				<radio @click="status_change" v-if="isshopcar" :checked="item.goods_state"></radio>
				<image :src="item.goods_small_logo" mode=""></image>
			</view>
			<view class="right">
				<view class="r_top go_wrap set_row_show">
					{{item.goods_name}}
				</view>
				<uni-icons @click="del_item(item.goods_id)" v-if="isshopcar" type="trash" size="20"></uni-icons>
				<view class="r_bottom">
					￥{{item.goods_count? item.goods_count*item.goods_price : item.goods_price | format_price}}
					<uni-number-box @change="num_change" :value="item.goods_count" class="unmber_box" v-if="isshopcar"></uni-number-box>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['item', 'isshopcar'],
		data() {
			return {
				
			};
		},
		methods: {
			nav_go() {
				this.$emit('click', this.item.goods_id)
			},
			num_change(value) {
				this.$emit('goodsCount_change', value, this.item)
			},
			status_change() {
				this.$emit('checked_status_change', {
					id: this.item.goods_id,
					g_state: !this.item.goods_state
				})
			},
			del_item(id) {
				this.$emit('del_goods_inshopcar', id)
			}
		},
		filters: {
			format_price(val) {
				return val.toFixed(2)
			}
		}
	}
</script>

<style lang="scss">
.listItem {
	border-bottom: 2px solid #CCCCCC;
	display: flex;
	height: 250rpx;
	padding: 20rpx 10rpx;
	box-sizing: border-box;
	.left {
		width: 30%;
		height: 100%;
		flex-shrink: 0;
		display: flex;
		align-items: center;
		image {
			flex: 1;
			width: 100%;
			height: 100%;
		}
		// radio {
			
		// }
	}
	.right {
		height: 100%;
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		box-sizing: border-box;
		margin-left: 10rpx;
		.r_bottom {
			color: #bc0000;
			position: relative;
			.unmber_box {
				position: absolute;
				top: -15rpx;
				right: 20rpx;
			}
		}
	}
}
</style>
